feat(solver_registry): writer-only obligation locks (#392 #394 #397 #398) - #443
Merged
james2177 merged 2 commits intoSep 30, 2026
Conversation
|
@misrasamuelisiguzor-oss Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
solver_registry: writer-only obligation locks (#392)
This PR delivers one acceptance-criteria item from #392. #394, #397 and #398 are referenced so that they close with this PR, but nothing from them is implemented here.
#392 Block registry exit while a solver has open obligations
What existed:
deregister_solverandunstakehad no notion of obligations in settlement, and there was no counter or per-intent lock in the registry.Done (AC1):
lock_obligation(caller, solver, intent_id) -> u32andrelease_obligation(caller, solver, intent_id) -> u32, returning the solver's open-obligation count.callermust be the configured writer (WriterNotSetif none,Unauthorizedotherwise, thenrequire_auth). Unlikerecord_fill, the admin is not accepted, so the counter only reflects real settlement state.DataKey::Obligation(solver, intent_id)marker. A repeated lock or release for the same intent leaves the count unchanged, and releasing an intent that was never locked is a no-op.DataKey::OpenObligations(solver)key, soSolverRecord's stored encoding is unchanged. It is removed at 0, and both keys get the persistent TTL bump.lock_obligationrequires a registered solver (SolverNotRegistered).release_obligationdoes not, so a stale lock can always be cleared.get_open_obligations(solver)andhas_obligation(solver, intent_id), plusobligation_locked/obligation_releasedevents carrying(intent_id, count).WriterNotSetbefore a writer is set); writer auth required; unregistered solver rejected.Not done in this PR:
unstakebelow the obligation-weighted floor andderegister_solverwith obligations failing withHasOpenObligations(AC2).#394 Time-decayed reputation and minimum tenure
Not done in this PR:
min_tenure_secsper tier, the minimum notional per counted fill, and decay-awaretier_for.#397
reputation_badgeproduction readinessNot done in this PR:
NonTransferabletraps.#398 Timelocked upgrades across satellite contracts
Not done in this PR:
propose_upgrade/execute_upgrade/cancel_upgrade/get_pending_upgradeand a versionedmigrate()in the three contracts.Verification
In
solver_registry:cargo test: 30 passed, 0 failed (23 existing + 7 new).cargo fmt --check: no findings on lines this PR adds.mainalready has fmt drift inlib.rs/test.rs, which is left untouched.cargo clippy --all-targets -- -D warnings: fails onmainwith the current stable clippy (manual_range_containsatset_tier_threshold, pre-existing, not touched). There are no findings on lines this PR adds.Closes #392
Closes #394
Closes #397
Closes #398